import request from "@/utils/request"

// 登录方法
// export function login(username, password, code, uuid) {
//   const data = {
//     username,
//     password,
//     uuid
//   }
//   return request({
//     url: '/login',
//     method: 'post',
//     params: data
//   })
// }
export function ApiLoginPL(url) {
  return request({
    url: `/login?state=${url}`,
    method: "get"
  })
}
export function ApiCallbackPL(code) {
  return request({
    url: `/callback?code=${code}`,
    method: "get"
  })
}
export function login(data) {
  return request({
    url: "/login",
    method: "post",
    data
  })
}

// 获取验证码
export function phoneCode(data) {
  return request({
    url: "/captchaImage_username",
    method: "get",
    params: data
  })
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: "/env/getInfo",
    method: "get"
  });
}

// 退出方法
export function ApiLogoutPL() {
  return request({
    url: "/logout",
    method: "get"
  })
}




export function singleLogout() {
  return request({
    url: '/env/esc-sso/cxf/api/v1/ssoSession/remove',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}